<template>
  <div class="dashboard-container">
    <!-- 地图背景层 -->
    <div class="map-layer">
      <cesium-map />
    </div>
    
    <!-- 内容层 -->
    <div class="content-layer">
      <!-- 顶部导航 -->
      <div class="nav-wrapper">
        <top-navigation />
      </div>
      
      <!-- 主内容区 -->
      <div class="main-content">
        <!-- 左侧面板插槽 -->
        <template v-if="hasLeftPanel">
          <slot name="left-panel">
            <placeholder-left-panel />
          </slot>
        </template>
        
        <!-- 中间区域插槽 -->
        <div class="center-area">
          <slot name="center-content"></slot>
        </div>
        
        <!-- 右侧面板插槽 -->
        <template v-if="hasRightPanel">
          <slot name="right-panel">
            <placeholder-right-panel />
          </slot>
        </template>
      </div>

      <!-- 底部导航插槽 -->
      <slot name="bottom-nav">
        <bottom-navigation>
          <slot name="nav-items"></slot>
        </bottom-navigation>
      </slot>
    </div>
  </div>
</template>

<script setup lang="ts">
import TopNavigation from '@/components/TopNavigation.vue'
import BottomNavigation from '@/components/BottomNavigation.vue'
import CesiumMap from '@/components/CesiumMap.vue'
import PlaceholderLeftPanel from '@/components/PlaceholderLeftPanel.vue'
import PlaceholderRightPanel from '@/components/PlaceholderRightPanel.vue'

interface Props {
  hasLeftPanel?: boolean
  hasRightPanel?: boolean
}

withDefaults(defineProps<Props>(), {
  hasLeftPanel: true,
  hasRightPanel: true
})
</script>

<style lang="scss" scoped>
.dashboard-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #1a1f3d;
}

.map-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: auto;
}

.content-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  
  .nav-wrapper {
    flex: none;
    width: 100%;
    pointer-events: auto;
    background: linear-gradient(to bottom,
      rgba(13, 19, 35, 0.8) 0%,
      rgba(13, 19, 35, 0.6) 50%,
      rgba(13, 19, 35, 0) 100%
    );
    z-index: 2;
  }
  
  .main-content {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    height: 100%;
    position: relative;
    z-index: 2;
    
    :deep(.left-section),
    :deep(.right-section),
    :deep(.placeholder-section) {
      pointer-events: auto;
    }
    
    .center-area {
      flex: 1;
      position: relative;
      padding: 16px;
      pointer-events: none;
      
      :deep(.floating-element) {
        pointer-events: auto;
      }
    }
  }
}

:deep(*) {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) rgba(0, 0, 0, 0.1);
  
  &::-webkit-scrollbar {
    width: 6px;
  }
  
  &::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
  }
  
  &::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    
    &:hover {
      background: rgba(255, 255, 255, 0.3);
    }
  }
}
</style> 